/*** Eclipse Class Decompiler plugin, copyright (c) 2012 Chao Chen (cnfree2000@hotmail.com) ***/
package com.feiyue.basic;

import android.content.Context;
import android.content.SharedPreferences;
import android.content.SharedPreferences.Editor;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;

public class Tool {
    public static int currentNet(Context context)
    {
        byte byte0;
        NetworkInfo networkinfo;
        byte0 = -1;
        networkinfo = ((ConnectivityManager)context.getSystemService("connectivity")).getActiveNetworkInfo();

        if (networkinfo != null && networkinfo.isAvailable())
            if (networkinfo.getType() == 1)
            {
                byte0 = 1;
            } else
            {
                int i = networkinfo.getSubtype();
                if (i == 3 || i == 5 || i == 6 || i == 8 || i == 10 || i == 9 || i == 2)
                    byte0 = 120;
                else
                    byte0 = 0;
            }
        return byte0;
    }

	public static long getFirstRunningTime(Context paramContext) {
		return paramContext.getSharedPreferences("Setting", 0).getLong(
				"FirstRunningTime", 0L);
	}

	public static void setFirstRunningTime(Context paramContext, long paramLong) {
		SharedPreferences.Editor localEditor = paramContext
				.getSharedPreferences("Setting", 0).edit();
		localEditor.putLong("FirstRunningTime", paramLong);
		localEditor.commit();
	}
}